<?php
class User_Form_Login extends Zend_Form {
	public function init() {
		$this->setMethod('post');
		$this->setAttrib('enctype', Zend_Form::ENCTYPE_MULTIPART);

		$this->addPrefixPath('Promotor_Form_Decorator_','Promotor/Form/Decorator', self::DECORATOR);

		$subForm = new Zend_Form_SubForm();
		$subForm->setAttribs(array(
			'legend' => 'Logowanie'
		));

		$subForm->addElement('text','username', array(
			'label' => 'Użytkownik',
			'required' => true,
			'validators' => array(
				'email' => 'EmailAddress',
				'strlen' => new Zend_Validate_StringLength(5)
			)
		));
		$subForm->addElement('password','password', array(
			'label' => 'Hasło',
			'required' => true,
			'validators' => array(
				'strlen' => new Zend_Validate_StringLength(5)
			)
		));
		
		$this->addSubForm($subForm, 'auth');
	} 
}